<?php
/**
 * Created by PhpStorm.
 * User: sunzexin
 * Date: 2018/2/1
 * Time: 18:23
 */

namespace App\Http\Controllers\MiniProgram;


use App\Http\Logics\MiniProgram\DistrictLogic;
use App\Http\Traits\DistrictTrait;
use App\Http\Controllers\BaseController;
class DistrictController extends BaseController
{
    use DistrictTrait;

    /**
     * @SWG\Get(
     *     path="/district/getList",
     *     tags={"District"},
     *     description="获取地区列表",
     *     operationId="getDistrictList",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="citycode",
     *         in="query",
     *         description="城市编码",
     *         required=false,
     *         type="string"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getDistrictList()
    {
        $citycode = $this->citycode;
        $data = [
            'citycode' => $citycode
        ];
        $response = DistrictLogic::getDistrictList($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }
}